package org.softTank.BC.dao;

import org.hibernate.Hibernate;
import org.softTank.BC.entity.services.Role;
import org.springframework.stereotype.Repository;
import org.springside.modules.orm.hibernate.HibernateDao;

/**
 * 角色对象的泛型DAO.
 * 
 * @author calvin
 */
@Repository
public class RoleDao extends HibernateDao<Role, Long> {

	@Override
	public void initEntity(Role entity) {
		Hibernate.initialize(entity.getPartnerLinkType());
		Hibernate.initialize(entity.getPortType());
		Hibernate.initialize(entity);
	}

	@Override
	public Role get(final Long id) {
		Role role = super.get(id);
		initEntity(role);

		return role;
	}
}
